<template>
  <div class="app">
    <button @click="getNews">点我获取头条新闻</button>
  </div>
</template>

<script>
  import axios from 'axios'
  export default {
    name:'App',
    methods: {
      getNews(){
        let x = axios.get('http://localhost:8080/hot-event/hot-board/?origin=toutiao_pc')
        x.then(
          (response)=>{console.log('成功',response.data.data)},
          (error)=>{console.log('失败',error)}
        )
      }
    },
  }
</script>

<style scoped>
  .app{
    background-color: #ddd;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 0 10px;
  }
</style>